import request from '@/utils/request'

export function getRolePerms(data) {
  console.log(data)
  return request({
    url: 'clinic/role/perm/list',
    method: 'post',
    params:data
  })
}

export function editRolePerms(data) {
  console.log(data)
  return request({
    url: '/clinic/role/perm/edit',
    method: 'post',
    data
  })
}


export function getRoles(data) {
  return request({
    url: 'clinic/role/list',
    method: 'post',
    data
  })
}

export function getRoleInfo() {
  return request({
    url: '/sys/role/list',
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/clinic/role/add',
    method: 'post',
    data
  })
}

export function updateRole(id, data) {
  return request({
    url: `/role/${id}`,
    method: 'put',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/role/${id}`,
    method: 'delete'
  })
}
